﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SDT.Lib.Paging;
using SDT.Model;
using SDT.Systems;
using System.Web.Mvc;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace SDT.Admin.ViewModels
{
    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 09/07/2011
    /// </summary>
    public class PollViewModels
    {
        public PollViewModels()
        {}

        public IPagedList<Poll> Polls
        {
            get;
            set;
        }

        public int? CurrentPubStatus;
        public string Keyword;
        public List<SelectListItem> ListStatusPub
        {
            get
            {
                List<SelectListItem> list = new CommonType().ToList();
                if (this.CurrentPubStatus.HasValue)
                    list.SingleOrDefault(i => int.Parse(i.Value) == this.CurrentPubStatus.Value).Selected = true;

                return list;
            }
        }
    }

    /// <summary>
    /// Author: Takamaru Nguyen
    /// Date: 09/07/2011
    /// </summary>
    public class PollInputModels
    {
        public PollInputModels()
        {
        }

        public List<SDT.Model.Menu> ListMenus
        {
            get;
            set;
        }

        public List<int> MenuID
        {
            get;
            set;
        }

        public List<PollCase> PollCases
        {
            get;
            set;
        }

        public Poll Poll
        {
            get;
            set;
        }

        public int ID
        {
            get;
            set;
        }

        private int _pollCaseIndex = 1;
        public int PollCaseIndex
        {
            get
            {
                return this._pollCaseIndex;
            }
            set
            {
                if (value > 0)
                    this._pollCaseIndex = value;
            }
        }
    }
}